#pragma once

#include <vector>
#include "EngineObject.h"
#include "ModelMesh.h"
#include "MeshSubset.h"
#include "ModelVertexBuffer.h"
#include "ModelIndexBuffer.h"
#include "Material.h"
#include "EnginePointer.h"

using namespace std;

class Model : public EngineObject
{
public:
	Model(vector<EnginePointer<ModelMesh>>* meshes,
		  vector<EnginePointer<MeshSubset>>* subsets,
		  vector<EnginePointer<ModelVertexBuffer>>* vertexBuffers,
	      vector<EnginePointer<ModelIndexBuffer>>* indexBuffers,
		  vector<EnginePointer<Material>>* materials);
	~Model(void);

	HRESULT LoadGraphicsContent(EnginePointer<ID3D10Device>& pDevice);
	void UnloadGraphicsContent();
	vector<EnginePointer<ModelMesh>>::iterator meshesBegin();
	vector<EnginePointer<ModelMesh>>::iterator meshesEnd();
	AUTO_SIZE;
private:
	vector<EnginePointer<ModelMesh>>* meshes;
	vector<EnginePointer<MeshSubset>>* subsets;
	vector<EnginePointer<ModelVertexBuffer>>* vertexBuffers;
	vector<EnginePointer<ModelIndexBuffer>>* indexBuffers;
	vector<EnginePointer<Material>>* materials;
};
